1. Field of the Invention
This application relates to the field of computer data storage and more particularly to the field of using a cache memory in a computer data storage device.
2. Description of Related Art
Host processor systems may store and retrieve data using a storage device containing a plurality of host interface units, disk drives, and disk interface units. Such storage devices are provided, for example, by EMC Corporation of Hopkington, Mass. and disclosed in U.S. Pat. No. 5,206,939 to Yanai et al., U.S. Pat. No. 5,778,394 to Galtzur et al., U.S. Pat. No. 5,845,147 to Vishlizzky et al., and U.S. Pat. No. 5,857,208 to Ofek. The host systems access the storage device through a plurality of channels provided therewith. Host systems provide data and access control information via the channels of the storage device and the storage device provides data to the host systems also through the channels. The host systems do not address the disk drives of the storage device directly, but rather, access what appears to the host systems as a plurality of logical disk units. The logical disk units may or may not correspond to the actual disk drives.
Performance of such a storage system may be improved by using a cache. In the case of a disk drive system, the cache may be implemented using a block of semiconductor memory that has a relatively lower data access time than the disk drive. Data that is accessed is advantageously moved from the disk drives to the cache so that the second and subsequent accesses to the data may be made to the cache rather than to the disk drives. Data that has not been accessed recently may be removed from the cache to make room for new data. Often such cache accesses are transparent to the host systems requesting the data.
In instances where the host systems write data to the disk, it may be efficient to have the write operation initially occur only in the cache. The data may then be transferred from the cache back to the disk at a later time, possibly after subsequent read and write operations. Transferring the modified cache data to the disk is referred to as xe2x80x9cdestagingxe2x80x9d.
If the cache memory fails after one or more write operations but prior to destaging the modified cache data to the disk, then the disk data may not match the data that was written by the host system. Such a situation may be especially troublesome in instances where the use of the cache is transparent to the host, i.e., in systems where the host system writes data and the write operation is acknowledged by the storage device (because the data is successfully written to the cache), but then the data is never appropriately transferred to the disk because of cache failure. Numerous solutions have been proposed to handle cache failures.
U.S. Pat. Nos. 5,437,022, 5,640,530, and 5,771,367, all to Beardsley et al, disclose a system having two, somewhatxe2x80x94independent, xe2x80x9cclustersxe2x80x9d that handle data storage. The clusters are disclosed as being designed to store the same data. Each of the clusters includes its disks own cache and non-volatile storage area. The cache from one of the clusters is backed up to the non-volatile data storage area of the other cluster and vice versa. In the event of a cache failure, the data stored in the corresponding non-volatile storage area (from the other cluster) is destaged to the appropriate disk. However, this system requires, in effect, a duplicate backup memory for each of the caches and also provides that whenever data is written to one of the caches, the same data needs to be written to the corresponding non-volatile storage in the other cluster. In addition, since each cluster includes a cache and a non-volatile storage, thus having two redundant clusters requires four memories (one cache for each of the clusters and one non-volatile storage for each of the clusters).
It is desirable to have a system that provides sufficient redundancy in the case of failure of a cache element without unduly increasing the complexity of the system or the number of elements that are needed.
According to the present invention, managing data in cache includes providing data from a disk storage area to a first cache memory, providing data from the disk storage area to a second cache memory, where the first and second cache memories contain at least some data that is not stored in the other one of the cache memories, and writing the same data to both of the cache memories in response to the data being modified while stored in the cache memories. Managing data in a cache may also include subdividing the first cache memory into primary and secondary storage areas, subdividing the second cache memory into primary and secondary storage areas, where primary areas of the first cache correspond to secondary areas of the second cache and where secondary areas of the first cache correspond to primary areas of the second cache, and providing data from the disk storage area to the one of the cache memories having a corresponding primary storage area. Managing data in a cache memory may also include subdividing the disk storage area into a plurality of slots, where each of the slots corresponds to a primary area of one of the cache memories and to a secondary area of the other one of the cache memories. Managing data in a cache may also include in response to data in a primary area of one of the cache memories being modified, copying related data into the corresponding secondary area of the other one of the cache memories. Managing data in a cache may also include providing control data for each of the areas of the cache memories, where the control data indicates whether the corresponding area has been modified since being provided to one of the cache memories from the disk storage area. Managing data in a cache may also include causing the control data for one of the cache memories to be the same as the control data for the other one of the cache memories. The control data may be written to both of the cache memories at the same time. In response to hardware for the first cache memory failing, the second cache memory may be used. Using the second cache memory may include using portions of the second cache memory corresponding to data provided to the second cache memory from the disk storage area. Managing data in a cache may also include for data stored in the first cache memory but not in the second cache memory, indicating that the data is not stored in cache after the first cache memory fails.
According further to the present invention, managing data in cache includes providing first and second physical cache areas, subdividing each of the first and second physical cache areas into first and second logical cache areas, where portions of the first logical cache area are provided on both the first and second physical cache areas and portions of the second logical cache area are provided on both the first and second physical cache areas, assigning portions of data from a disk storage area to one of: the first logical cache area and the second logical cache area, and providing data from the disk storage area to one of the physical cache areas according to assignment of the data to a particular one of the logical cache areas. Managing data in a cache may also include writing data to both of the physical cache areas in response to the data being modified while stored in the cache. Managing data in a cache may also include providing control data for portions of the physical cache areas, where the control data indicates whether the corresponding portion has been modified since being provided from the disk storage area. Managing data in a cache may also include causing control data from one of the physical cache areas to equal control data from the other one of the physical cache areas. The control data may be written to both of the physical cache areas each time the control data is modified. Managing data in a cache may also include, in response to hardware for one of the physical cache areas failing, using the other one of the physical cache areas.